import { call, put, takeEvery, takeLatest } from 'redux-saga/effects';
import { SAVE_USER_ASYNC } from 'store/actions/user/actionType';
import { saveUserAction } from 'store/actions/user/index';
import { getUserInfo, } from 'api/user';


function* rootSaga() {
  yield takeLatest(SAVE_USER_ASYNC, function* () {
    // @ts-ignore
    const response = yield call(getUserInfo)
    yield put(saveUserAction(response))
  });

}

export default rootSaga